/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __INPUT_HARD_MACX_KEYBOARD_H__
#define __INPUT_HARD_MACX_KEYBOARD_H__

#include <input/hard/Hardware.h>
#include <input/Manager.h>
#include <input/hard/ForceEffect.h>
#include <NoCopy.h>
#include <Symap.h>

namespace liba
{
namespace input
{
namespace hard
{
namespace macx
{

class ForceEffect : public hard::ForceEffect
{
public:    
	virtual ~ForceEffect()
	{}
	virtual bool play();
	virtual bool stop() { return true; }
	virtual bool is_playing() { return false; }
};
	

class Keyboard : public Hardware, private Nocopy
{
public:
	virtual std::string get_name()const;
	virtual Atom get_type()const
	{
		return Manager::keyboard_type_name;
	}

	void key_down( int scan_code );
	void key_up( int scan_code );
	void key_char( wchar_t letter );

	virtual double get_axis_position( const std::string & axis_name )const;
	virtual Manager::AxisType get_axis_type( const std::string & axis_name )const;

	virtual hard::ForceEffect * create_force_effect( const filesystem::String & effect_name );
	
	Keyboard();
	virtual ~Keyboard();
private:
	Symap<int, std::string> symbol_symap;
	std::string get_name_by_code( int scan_code )const;
	int get_code_by_name( const std::string & name )const;
};

} // namespace macx
} // namespace hard
} // namespace input
} // namespace liba
using namespace liba;

#endif //__INPUT_HARD_MACX_KEYBOARD_H__
